
#!/bin/env python3
# -*- coding:utf-8 -*-
"""
    启动 微服务执行体(callee)
"""

from e4ting           import log
from core.game.callee import GameServer
from config           import WampSetting

def options():
    import argparse,sys
    parser = argparse.ArgumentParser(
        prog="python3 -m core.game",
        description="游戏平台"
    )
    parser.add_argument(
        '--name',
        action='store',
        type=str,
        default="room",
        help='名字（用英文）'
    )
    parser.add_argument(
        '--url',
        action='store',
        type=str,
        default=WampSetting.game_server,
        help='WAMP url '
    )
    parser.add_argument(
        '--realm',
        action='store',
        type=str,
        default="e4ting",
        help='WAMP realm'
    )
    return parser.parse_args()

if __name__ == "__main__":

    op = options()

    log.info(op.url)

    GameServer(url=op.url, realm=op.realm, nodeid=op.name).main()


